<?php

declare(strict_types=1);

namespace App\Job;

use App\Exception\BusinessException;
use App\Model\Moment;
use Hyperf\AsyncQueue\Job;
use Psr\Container\ContainerInterface;

/**
 * Class MomentsJob
 * @package App\Job
 */
class MomentsJob extends Job
{

    public $params;

    public function __construct($params)
    {
        $this->params = $params;
    }

    /**
     * @inheritDoc
     */
    public function handle()
    {
        // TODO: Implement handle() method.
        (new Moment())->page_view_count($this->params[0] ?? 0);
        $this->compress();
    }
}